package com.yatong.commons.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * @program: YaTong
 * @description: UUID封装
 * @author: Mr.Guo
 * @create: 2018-09-21 16:14
 **/
public class UUIdUtil {
    /**
     * UUID清除横杠方法
     * @return
     */
    public String RemoveBars(){
        String uuid = UUID.randomUUID().toString();
        uuid = uuid.replace("-", "");
        return uuid;
    }

    /**
     * 时间+模块代码+UUID
     * @param mark
     * @return
     */
    public String SJUUId(String mark){
        String date = new SimpleDateFormat("yyMMddHHmmssSSS").format(new Date());
        String id = UUID.randomUUID().toString().substring(0, 13).replace("-", "");
        return date + mark + id;
    }
}
